package com.wlhse.controller;

import com.wlhse.dto.inDto.CheckRecordQueryInDto;
import com.wlhse.dto.inDto.ProblemListInDto;
import com.wlhse.dto.outDto.ProblemListOutDto;
import com.wlhse.service.CheckRecordService;
import com.wlhse.service.ProblemListService;
import com.wlhse.util.GetCurrentUserIdUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

//问题清单
@RestController("ProblemListController")
@RequestMapping("/api/v1")
public class ProblemListController {

    @Resource
    private ProblemListService problemListService;

    //分页查询
    @RequestMapping(value = "/problemLists", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String problemList(@ModelAttribute ProblemListInDto problemListInDto, @RequestParam(value = "num",required = false) Integer num,
                              @RequestParam(value = "size",required = false) Integer size, HttpServletRequest request) {
        return problemListService.ProblemListPuls(problemListInDto,num, size, request);
    }

    @RequestMapping(value = "/problemLists2", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String problemLists2(@ModelAttribute ProblemListInDto problemListInDto, @RequestParam(value = "num",required = false) Integer num,
                              @RequestParam(value = "size",required = false) Integer size, HttpServletRequest request) {
        return problemListService.ProblemListPuls2(problemListInDto,num, size, request);
    }
}
